package com.edu.mapper;

import com.edu.bean.Goods;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface GoodsMapper {
    @Select("select * from goods where goodsId = #{goodsId}")
    Goods selectById(int goodsId);

    @Insert("insert into goods (goodsName,goodsPrice) values (#{goodsName},#{goodsPrice})")
    void insertGoods(Goods goods);

    @Delete("delete from goods where goodsId = #{goodsId}")
    void deleteGoods(int goodsId);

    @Update("update goods set goodsName = #{goodsName},goodsPrice = #{goodsPrice} where goodsId = #{goodsId}")
    void updateGoods(Goods goods);
}
